package com.jinkaimen.goodcash.ui.weiget.utils;

import android.widget.TextView;

/**
 * Created by wei.shuxin on 2016/12/30.
 */

public class ViewUtils {

    /**
     * 向textView添加drawable
     *
     * @param textView 被添加的TextView
     * @param drawableId    图片的资源id
     * @param where    1 2 3 4 对应 左 上 右 下
     */
    public static void addDrawable2TvById(TextView textView, int drawableId, int where) {
        textView.setCompoundDrawablesWithIntrinsicBounds(where == 1 ? drawableId : 0, where == 2 ? drawableId : 0, where == 3 ? drawableId : 0, where == 4 ? drawableId : 0);
    }
}
